<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>

<div class="maindivcontact">

	<sf:form modelAttribute="registerObj">
		<h3>Main Contact Person Information</h3>
		<div class="error">All fields are mandatory</div>
		<table class="tbl maincontacttable">

			<tbody>
				<tr>
					<td>Salutation</td>
					<td><sf:select path="salutation">
							<sf:option value="">--Select--</sf:option>
							<sf:option value="Mr">Mr</sf:option>
							<sf:option value="Ms">Ms</sf:option>
							<sf:option value="Mrs">Mrs</sf:option>
							<sf:option value="Dr">Dr</sf:option>
							<sf:option value="Prof">Prof</sf:option>
						</sf:select>
						<br/><sf:errors path="salutation" cssClass="error" />
					</td>
				</tr>
				<tr>
					<td>Family Name/Last Name</td>
					<td style="max-width:300px;">
						<sf:input path="lastName" size="60" maxlength="200" />
						<br/><sf:errors path="lastName" cssClass="error" />
					</td>
				</tr>
				<tr>
					<td>First Name</td>
					<td style="max-width:300px;"><sf:input path="firstName" size="60" maxlength="200" /> 
					<br/><sf:errors path="firstName" cssClass="error" /></td>
				</tr>
				<tr>
					<td>Designation</td>
					<td style="max-width:300px;"><sf:input path="designation" size="60" maxlength="200" />
					<br/><sf:errors path="designation" cssClass="error" /></td>
				</tr>
				<tr>
					<td>Contact Number</td>
					<td><sf:input path="telephone" size="60" maxlength="8" />
					<br/><sf:errors path="telephone" cssClass="error" /> </td>
				</tr>
				<tr>
					<td>Email Address</td>
					<td style="max-width:300px;"><sf:input path="email" size="60" maxlength="200" /> 
					<br/><sf:errors path="email" cssClass="error" /> </td>
				</tr>
				<tr>
					<td>Organisation Name</td>
					<td><c:choose>
							<c:when test="${registerObj.pledger}">
								<c:out value="${registerObj.companyName}" />
								<c:if test="${empty registerObj.companyName}">
									<c:out value="${registerObj.companyNameOther}" />
								</c:if>
							</c:when>
							<c:otherwise>
								<sf:input path="companyName" size="60" maxlength="200" />
								<br/><sf:errors path="companyName" cssClass="error" />
							</c:otherwise>
						</c:choose> </td>
				</tr>
				<tr>
					<td>Organisation Address</td>
					<td style="max-width:300px;"><sf:input path="companyAddress" size="60" maxlength="200" />
						<br/><sf:errors path="companyAddress" cssClass="error" /> 
						<c:if test="${registerObj.pledger and not registerObj.otherCompany }">
							Click <a href="javascript:showNewAddress();">here</a> to change address
						</c:if>
					</td>
				</tr>
				<tr class="newAddressTr">
					<td>New Address</td>
					<td><sf:input path="newAddress" size="60" maxlength="200" />
						<br/><sf:errors path="newAddress" cssClass="error" /></td>
				</tr>
				<tr>
					<td colspan="2">
						<div>
							<p style="font-size: 14px;">
								Are you interested to receive any update about Fair Employment Practices?&nbsp;&nbsp;
								<sf:radiobutton path="receiveUpdate" value="true" label="Yes" />
								<sf:radiobutton path="receiveUpdate" value="false" label="No" />
								<br/><sf:errors path="receiveUpdate" cssClass="error" />
							</p>
						</div>
					</td>
				</tr>
				<c:if test="${not registerObj.otherCompany}">
				<tr>
					<td colspan="2">
						Please select the number of participants you would like to register for
						<sf:select path="noParticipant">
							<c:forEach var="i" begin="0" end="10">
								<sf:option value="${i}"/>
							</c:forEach>
						</sf:select>
						<br/><sf:errors path="noParticipant" cssClass="error" style="padding-left: 415px;"/>
					</td>
				</tr>
				</c:if>
			</tbody>
		</table>
		
		
		<div class="butdiv">
		<input type="submit" name="_eventId_next" value="Next"> <input
				type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}" />

		</div>
		
	</sf:form>
	<br/>
</div>

<script type="text/javascript">
	$(".newAddressTr").hide();
</script>